package com.test;

/*
//多态
abstract class Animal {
    abstract void shout();      //定义抽象shout()方法
}

class Cat extends Animal{
    public void shout(){
        System.out.println("喵喵");
    }
}

class Dog extends Animal{
    public void shout(){
        System.out.println("汪汪");
    }
}

public class Example06 {
    public static void  main(String[] args){
        Animal animal_1=new Cat();      //创建Cat类的对象并转型为Animal类的对象
        Animal animal_2=new Dog();      //创建Dog类的对象并转型为Animal类的对象
        animal_1.shout();
        animal_2.shout();
    }
}

 */
